package dialer.ws.base.entity;

import java.io.Serializable;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name = "form_field", schema = "call_center")
@NamedQueries({ @NamedQuery(name = "getFormFieldById", query = "from FormField where id_form=:id_form") })
public class FormField implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 6905660556647101199L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false)
	private Integer id;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "id_form", nullable = false)
	private Form form;

	@Column(name = "etiqueta", nullable = false)
	private String etiqueta;

	@Column(name = "value", nullable = false, columnDefinition = "TEXT")
	private String value;

	@Column(name = "tipo", nullable = false)
	private String tipo;

	@Column(name = "orden", nullable = false)
	private Integer orden;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "formField")
	private List<FormDataRecolectedEntry> listFormDataRecolectedEntry;

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "formField")
	private List<FormDataRecolected> listFormDataRecolected;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Form getForm() {
		return form;
	}

	public void setForm(Form form) {
		this.form = form;
	}

	public String getEtiqueta() {
		return etiqueta;
	}

	public void setEtiqueta(String etiqueta) {
		this.etiqueta = etiqueta;
	}

	public String getValue() {
		return value;
	}

	public void setValue(String value) {
		this.value = value;
	}

	public String getTipo() {
		return tipo;
	}

	public void setTipo(String tipo) {
		this.tipo = tipo;
	}

	public Integer getOrden() {
		return orden;
	}

	public void setOrden(Integer orden) {
		this.orden = orden;
	}

	public List<FormDataRecolectedEntry> getListFormDataRecolectedEntry() {
		return listFormDataRecolectedEntry;
	}

	public void setListFormDataRecolectedEntry(List<FormDataRecolectedEntry> listFormDataRecolectedEntry) {
		this.listFormDataRecolectedEntry = listFormDataRecolectedEntry;
	}

	public List<FormDataRecolected> getListFormDataRecolected() {
		return listFormDataRecolected;
	}

	public void setListFormDataRecolected(List<FormDataRecolected> listFormDataRecolected) {
		this.listFormDataRecolected = listFormDataRecolected;
	}

}
